import os

basedir = os.path.abspath(os.path.dirname(__file__))
yourpassword = 'lqeiJZU+0FTa'

class Config:
    DEBUG = False

class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:rootwsh@localhost:3306/GateIo'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    CACHE_TYPE = 'redis'
    CACHE_REDIS_HOST = 'localhost'
    CACHE_REDIS_PORT = 6379
    CACHE_REDIS_DB = 0
    CACHE_REDIS_URL = f'redis://:{yourpassword}@localhost:6379/0'
    CELERY_BROKER_URL = f'redis://:{yourpassword}@localhost:6379/0'
    CELERY_RESULT_BACKEND = f'redis://:{yourpassword}@localhost:6379/0'

class ProductionConfig(Config):
    DEBUG = False
    SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://gateio1:KJWywLWNEYWC6wdN@localhost:3306/gateio1'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    CACHE_TYPE = 'redis'
    CACHE_REDIS_HOST = 'localhost'
    CACHE_REDIS_PORT = 6379
    CACHE_REDIS_DB = 0
    CACHE_REDIS_URL = f'redis://:{yourpassword}@localhost:6379/0'
    CELERY_BROKER_URL = f'redis://:{yourpassword}@localhost:6379/0'
    CELERY_RESULT_BACKEND = f'redis://:{yourpassword}@localhost:6379/0'

config_by_name = dict(
    dev=DevelopmentConfig,
    prod=ProductionConfig
)
